package com.css.apps.base.role.model;

import java.util.List;

import com.css.db.query.QueryCache;

@SuppressWarnings("serial")
public class SRoleFunc implements java.io.Serializable {

	private String uuid;
	private String roleId;
	private String funcId;

	public String getRoleId() {
		return this.roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getFuncId() {
		return this.funcId;
	}

	public void setFuncId(String funcId) {
		this.funcId = funcId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof SRoleFunc))
			return false;
		SRoleFunc castOther = (SRoleFunc) other;

		return ((this.getRoleId() == castOther.getRoleId()) || (this.getRoleId() != null
				&& castOther.getRoleId() != null && this.getRoleId().equals(castOther.getRoleId())))
				&& ((this.getFuncId() == castOther.getFuncId()) || (this.getFuncId() != null
						&& castOther.getFuncId() != null && this.getFuncId().equals(castOther.getFuncId())));
	}

	public int hashCode() {
		int result = 17;
		result = 37 * result + (getRoleId() == null ? 0 : this.getRoleId().hashCode());
		result = 37 * result + (getFuncId() == null ? 0 : this.getFuncId().hashCode());
		return result;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	@SuppressWarnings("unchecked")
	public static List<SRoleFunc> getRoleFuncByfuncId(String funcId) {
		QueryCache qc = new QueryCache(" select a.uuid from SRoleFunc a where a.funcId=:funcId ").setParameter("funcId",
				funcId);
		return QueryCache.idToObj(SRoleFunc.class, qc.list());
	}
}